{% extends "base.jinja" %}

{% block title %}{{user_home}}的个人空间{% endblock %}
{% block keywords %}{{user_home}},{{site_options.keyword}}{% endblock %}
{% block description %}{{user_home}}的个人空间{% endblock %}

{% block css %},user.css{% endblock %}

{% block main %}
    {%- include 'user/head.jinja' -%}

    <div class="page uh-albox" id="uh-albbox">
        <div class="u-crumb">
            <h3>{% if is_home%}我的{% endif %}灵感板</h3>
            {% if is_home %}
                <a class="uha-create" id="uha-create" href="javascript:;">创建灵感板</a>
            {% endif %}
        </div>
        
        <ul>
            <li>
                <div class="uha-hd">
                    {% if like_data[0] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/like/"><img width="240" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{like_data[0].cover}}!240" /></a>
                    {% endif %}
                </div>
                <div class="uha-col">
                    {% if like_data[1] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/like/"><img width="118" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{like_data[1].cover}}!240" /></a>
                    {% endif %}
                </div>
                <div class="uha-side">
                    {% if like_data[2] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/like/"><img width="118" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{like_data[2].cover}}!240" /></a>
                    {% endif %}
                </div>
                <span class="uha-num">{{like_total}}P</span>
                <div class="uha-title">喜欢</div>
            </li>
            {% for album in album_covers %}
            <li>
                <div class="uha-hd">
                    {% if album.images[0] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/album/{{album.id}}/"><img width="240" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{album.images[0].path}}!240" /></a>
                    {% endif %}
                </div>
                <div class="uha-col">
                    {% if album.images[1] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/album/{{album.id}}/"><img width="118" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{album.images[1].path}}!240" /></a>
                    {% endif %}
                </div>
                <div class="uha-side">
                    {% if album.images[2] %}
                        <a target="_blank" href="{{domain}}u/{{user_home.id}}/album/{{album.id}}/"><img width="118" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{album.images[2].path}}!240" /></a>
                    {% endif %}
                </div>
                <span class="uha-num">{{album.count}}P</span>
                <div class="uha-title">
                    <p>{{album.name}}</p>
                    {% if is_home %}
                        <div class="uha-edit">
                            <input type="text" class="inp-text" value="{{album.name}}" />
                            <a class="inp-btn-gray" href="javascript:;" data-aid="{{album.id}}">删除</a>
                            <a class="inp-btn-pk" href="javascript:;" data-aid="{{album.id}}">确定</a>
                        </div>
                        <span class="uha-edit-btn">编辑</span>
                    {% endif %}
                </div>
            </li>
            {% endfor %}
        </ul>
    </div>
    
    {% if not album_covers %}
    <input type="hidden" id="ug-content" value="11@uha-create@-280@35" />
    {% endif %}
{% endblock %}

{% block script %}
<script>seajs.use('page/user/album', function(p){p.render()});</script>
{% endblock %}